package com.atguigu.jvm1205;

import java.util.Random;
import java.util.UUID;

/**
 * @author gcq
 * @Create 2020-12-02
 */
public class T2 {
    public static void main(String[] args) {

        while(true){
            System.out.println(UUID.randomUUID().toString());
        }
    }

    private static void getOutofMemoryError() {

        String str = "www.atguigu.com";
        while (true) {
            str += str + new Random().nextInt(8888888) + new Random().nextInt(888888888);
        }
    }

    private static void showCpuInfo() {
        long maxMenory = Runtime.getRuntime().maxMemory(); //返回 Java虚拟机试图使用的最大内存量
        long totalMemory = Runtime.getRuntime().totalMemory(); //Java虚拟机中内存总量
        System.out.println("-Xmx:MAX_MOMORY = " + maxMenory + "(字节)、" + (maxMenory / (double)1024 / 1024) + "MB");
        System.out.println("-Xms:TOTAL_MEMORY = " + totalMemory + "(字节)、" + (totalMemory / (double)1024 / 1024) + "MB");
    }
}